package com.magnificent.atlantis.server.ui.panels.interaction.table;

import com.magnificent.atlantis.common.entity.ServerUser;
import com.magnificent.atlantis.common.entity.research.ServerUserInteraction;
import com.magnificent.atlantis.server.database.AtlantisDataSource;

import javax.swing.table.DefaultTableModel;
import java.util.List;

/**
 * User: Babanin
 * Date: 26.08.2009
 * Time: 1:54:39
 */
public class UserInteractionTableModel extends DefaultTableModel {
    private ServerUser serverUserOne;
    private ServerUser serverUserTwo;

    private List<ServerUserInteraction> interactionList;

    public UserInteractionTableModel(ServerUser serverUserOne, ServerUser serverUserTwo) {
        this.serverUserOne = serverUserOne;
        this.serverUserTwo = serverUserTwo;

        initialize();
    }

    private void initialize() {
        interactionList = AtlantisDataSource.getInstance().getInteractions(serverUserOne, serverUserTwo);
    }

    @Override
    public boolean isCellEditable(int row, int column) {
        return false;
    }
}
